package creatType.Singleton;

public class Singleton2 {

    private Singleton2() {
        System.out.println("I am Singleton2!");
    }
    // 相比于Singleton1不存在相率问题,但是每次加载都要初始化,耗费资源
    private static Resource r = new Resource("Singleton2");

    public static Resource getSingleton() {
        return r;
    }
}
